package com.example.lib_cache.model;

import android.widget.ImageView;

import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;
import androidx.databinding.BindingAdapter;

import com.baidu.mapapi.model.LatLng;

public class Poi extends BaseObservable {
    //地名
    private String poiName;
    //位置
    private String poiAddress;
    //图标
    private Integer image;
    //坐标
    private LatLng latLng;

    @Bindable
    public String getPoiName() {
        return poiName;
    }

    public void setPoiName(String poiName) {
        this.poiName = poiName;
//        notifyPropertyChanged(BR.poiName);
    }

    @Bindable
    public String getPoiAddress() {
        return poiAddress;
    }

    public void setPoiAddress(String poiAddress) {
        this.poiAddress = poiAddress;
//        notifyPropertyChanged(BR.poiAddress);
    }

    @Bindable
    public Integer getImage() {
        return image;
    }

    public void setImage(Integer image) {
        this.image = image;
//        notifyPropertyChanged(BR.image);
    }


    public LatLng getLatLng() {
        return latLng;
    }

    public void setLatLng(LatLng latLng) {
        this.latLng = latLng;
    }

    /**
     * 设置图片资源
     * @param imageView
     * @param resource
     */
    @BindingAdapter({"android:src"})
    public static void SetImageResource(ImageView imageView ,int resource){
        imageView.setImageResource(resource);
    }
}
